package com.zhentao.day03.am;

public class StudentTest {

  public static void main(String[] args) {
    Student student = new Student();
    student.setName("孙杉杉");
    student.setChengJi(90.0);
    // student.name = "孙杉杉";
    // student.chengJi = 90.0;
    //
    // System.out.println(student.name);
    // System.out.println(student.chengJi);
    System.out.println("student.getChengJi() = " + student.getChengJi());
    System.out.println(student.getName());
  }

}

class Student {
  // 私有化, 只能在类体内访问.
  private String name ;
  private double chengJi ;

  public void setName(String name) {
    this.name = name ;
  }
  public String getName (){
    return this.name ;
  }

  public void setChengJi(double chengJi) {
    this.chengJi = chengJi ;
  }
  public double getChengJi (){
    return this.chengJi ;
  }

}